/*
 * Transport functional.
 * Responsible for client-server transfer
 */
 
function doStart() {
	$.ajax({
 		url: "/Gomoku/go?action=start",
 		success: function (data) {
			// do smth
 		}
	});	
}

function doFinish() {
	$.ajax({
 		url: "/Gomoku/go?action=finish",
 		success: function (data) {
			// do smth
 		}
	});	
}
 
function doTurn(x, y) {
 	var position = new Object();
 	position.x = x;
 	position.y = y;
 	
 	$.ajax({
 		url: "/Gomoku/go?action=turn&data=" + $.toJSON(position),
 		success: function (data) {
 			refreshBoard($.evalJSON(data).cellStates);
 		}
	});	
}